<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY css SYSTEM "../phaidros.css">
]>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

<!-- main HTML template -->
<xsl:template match="/">
<xsl:variable name="file" select="//response/@file"/>
<xsl:variable name="groupName" select="//response/@groupName"/>
<xsl:variable name="groupId" select="//response/@id"/>
<xsl:variable name="parentId" select="//response/@parentId"/>
<xsl:variable name="childPrompt" select="*/strings/string[@name='ChildPrompt']/@value"/>
<xsl:variable name="groupNamePrompt" select="*/strings/string[@name='GroupName']/@value"/>
<xsl:variable name="editGroupTitle" select="*/strings/string[@name='EditGroupTitle']/@value"/>
<xsl:variable name="topLevel" select="*/strings/string[@name='TopLevel']/@value"/>
<html>
<head>
<style type="text/css">
&css;
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script type="text/javascript">
function submitGroup()
{
	var groupNameField = document.getElementById("GroupName");
	var parentIdField = document.getElementById("ParentId");
	var groupNameTextBox = document.getElementById("GroupNameTextBox");
	var parentPopup = document.getElementById("ParentPopup");
	var groupIdField = document.getElementById("GroupId");
	groupNameField.value = groupNameTextBox.value;
	parentIdField.value = parentPopup.options[parentPopup.selectedIndex].value;
	document.submission.submit();
}
</script>
</head>
<body>
<form name="submission" action="/Alpha/EditVersions" method="post">
<table class="group" width="30%">
<tr>
<th colspan="2">
<xsl:value-of select="concat($editGroupTitle,' ',$groupName)"/>
</th>
</tr>
<tr>
<td align="right">
<input type="text" id="GroupNameTextBox">
	<xsl:attribute name="value">
		<xsl:value-of select="$groupName"/>
	</xsl:attribute>
</input>
<xsl:text> <xsl:value-of select=" $childPrompt "/> </xsl:text>
</td>
<td>
<select id="ParentPopup">
	<option>
		<xsl:attribute name="value">
			<xsl:value-of select="0"/>
		</xsl:attribute>
		<xsl:value-of select="$topLevel"/>
	</option>
	<xsl:for-each select="//group">
	<xsl:if test="@name!=$groupName">
	<option>
		<xsl:attribute name="value">
			<xsl:value-of select="@id"/>
		</xsl:attribute>
		<xsl:if test="@id=$parentId">
			<xsl:attribute name="selected">
				<xsl:value-of select="selected"/>
			</xsl:attribute>
		</xsl:if>
		<xsl:value-of select="@name"/>
	</option>
	</xsl:if>
</xsl:for-each>
</select>
</td>
</tr>
<tr><td/><td><input type="button" onclick="submitGroup()" value="OK"/></td></tr>
</table>
<!-- submission fields -->
<input type="hidden" name="GroupName" id="GroupName" value=""/>
<input type="hidden" name="GroupId" id="GroupId"><xsl:attribute name="value"><xsl:value-of select="$groupId"/></xsl:attribute></input>
<input type="hidden" name="ParentId" id="ParentId" value="0"/>
<input type="hidden" name="Command" value="ChangeGroup"/>
<input type="hidden" name="File" id="File">
	<xsl:attribute name="value"><xsl:value-of select="$file"/></xsl:attribute>
</input>
</form>
</body>
</html>
</xsl:template>

</xsl:stylesheet>